package io.renren.modules.sys.controller;

import com.github.pagehelper.PageInfo;
import io.renren.common.pojo.R;
import io.renren.modules.sys.entity.SysLogEntity;
import io.renren.modules.sys.pojo.SysLogQuery;
import io.renren.modules.sys.service.SysLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 系统日志
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2017-03-08 10:40:56
 */
@RestController
@RequestMapping("/sys/log")
@Api(description = "系统日志接口")
public class SysLogController extends BaseSysController{
	@Autowired
	private SysLogService sysLogService;
	
	/**
	 * 列表
	 */
	@GetMapping("/list")
	@PreAuthorize("hasAuthority('sys:log:list')")
	@ApiOperation("获取系统日志列表")
	public R<PageInfo<SysLogEntity>> list(SysLogQuery query){
		PageInfo<SysLogEntity> pageInfo = sysLogService.queryPage(query);
		return R.ok(pageInfo);
	}
	
}
